#include "const.h"
#include "pinDefinitions.h"


//#define RTC_ENABLE
#define TIME_ENABLE
//#define FAN_ENABLE
//#define DISPLAY_ENABLE
#define SHT15_ENABLE
#define LM35_ENABLE
#define WEB_ENABLE
#define STORAGE_ENABLE
#define SENSORS_ENABLE
#define ACTORS_ENABLE

void setup() {
  Serial.begin(SERIAL_BAUD);
    
  // COMMAND
  setupCommand(); 
  
  // STORAGE
  #ifdef STORAGE_ENABLE
    setupStorage();
  #endif
  
  // SHT15
  #ifdef SHT15_ENABLE
    setupSHT15();
  #endif
  
  // LM35
  #ifdef LM35_ENABLE
    setupLM35();
  #endif  
  
  // DISPLAY
  #ifdef DISPLAY_ENABLE
    setupDisplay();
  #endif   
  
  // WEB
  #ifdef WEB_ENABLE
    setupWeb();
  #endif   
    
  // TIME
  #ifdef TIME_ENABLE
    setupTime();
  #endif   
  
  // SENSORS
  #ifdef SENSORS_ENABLE
    setupSensors();
  #endif  
  
  // ACTORS
  #ifdef ACTORS_ENABLE
    setupActors();
  #endif  
}


void loop() {
  updateTimeDelay();
  readCommand();
  #ifdef DISPLAY_ENABLE
    printDisplayDelay();
  #endif
  
  #ifdef WEB_ENABLE
    logToWebDelay();
    printWeb();
  #endif  
  
  // SENSORS
  #ifdef SENSORS_ENABLE
    readSesnorsDelay();
  #endif  
  
  // ACTORS
  #ifdef ACTORS_ENABLE
    processActorsDelay();
  #endif  
}

/*************************************** 
 * 
 * helpers
 *
 ***************************************/

